package com.icatw.blog.domain;

import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import com.fasterxml.jackson.databind.ser.std.ToStringSerializer;
import com.icatw.common.annotation.Excel;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

import java.io.Serializable;

/**
 * 文章对象 ms_article
 *
 * @author icatw
 * @date 2022-09-09
 */
@Data
@NoArgsConstructor
@AllArgsConstructor
@TableName("ms_article")
public class Article implements Serializable {
    private static final long serialVersionUID = 1L;

    /**
     * $column.columnComment
     */
    @JsonSerialize(using = ToStringSerializer.class)
    @TableId
    private Long id;

    /**
     * 评论数量
     */
    private Long commentCounts;

    /**
     * 创建时间
     */
    @Excel(name = "创建时间")
    @JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8")
    private Long createDate;

    /**
     * 简介
     */
    private String summary;

    /**
     * 标题
     */
    @Excel(name = "标题")
    private String title;

    /**
     * 浏览数量
     */
    private Long viewCounts;

    /**
     * 是否置顶
     */
    @Excel(name = "是否置顶")
    private Long weight;

    /**
     * 作者id
     */
    @Excel(name = "作者id")
    @JsonSerialize(using = ToStringSerializer.class)
    private Long authorId;

    @TableField(exist = false)
    private User user;
    /**
     * 内容id
     */
    private Long bodyId;

    /**
     * 类别id
     */
    @Excel(name = "类别id")
    private Long categoryId;

    @TableField(exist = false)
    private Category category;

}
